<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class File</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> File - 文件操作类（含上传）</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">File类描述</div>
	<div class="nav-bar">
					<span class="disabled">描述</span> |
															<a href="#sec-method-summary">方法</a> (<a href="#sec-methods">详情</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">文件操作类（含上传操作）</p>
<p class="description"><p>本程序主要作用管理文件和上传文件以及删除文件等</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> 张旭刚</li>
				<li><span class="field">version:</span> v1.0 beta</li>
				<li><span class="field">copyright:</span> Copyright (c) ink工作室 (http://www.inkphp.com)</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_core---Lib---File.class.php.html">/core/Lib/File.class.php</a> (line <span class="field">12</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">方法摘要</span></div>
		<div class="nav-bar">
			<a href="#sec-description">描述</a> |
												<span class="disabled">方法</span> (<a href="#sec-methods">详情</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																																																																								<div class="method-definition">
					<img src="../media/images/Constructor.png" alt=" "/>
											<span class="method-result">File</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
										()
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#createDir" title="details" class="method-name">createDir</a>
											(<span class="var-type">type</span>&nbsp;<span class="var-name">$path</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">type</span>
										<a href="#getDir" title="details" class="method-name">getDir</a>
											(<span class="var-type">type</span>&nbsp;<span class="var-name">$dir</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">type</span>
										<a href="#getExtName" title="details" class="method-name">getExtName</a>
											(<span class="var-type">type</span>&nbsp;<span class="var-name">$filename</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">type</span>
										<a href="#isExist" title="details" class="method-name">isExist</a>
											(<span class="var-type">type</span>&nbsp;<span class="var-name">$path</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">type</span>
										<a href="#readFile" title="details" class="method-name">readFile</a>
											(<span class="var-type">type</span>&nbsp;<span class="var-name">$file</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setIsRename" title="details" class="method-name">setIsRename</a>
											([<span class="var-type">type</span>&nbsp;<span class="var-name">$status</span> = <span class="var-default">true</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setLimitHeight" title="details" class="method-name">setLimitHeight</a>
											([<span class="var-type">type</span>&nbsp;<span class="var-name">$height</span> = <span class="var-default">0</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setLimitSize" title="details" class="method-name">setLimitSize</a>
											([<span class="var-type">type</span>&nbsp;<span class="var-name">$size</span> = <span class="var-default">200</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setLimitType" title="details" class="method-name">setLimitType</a>
											([<span class="var-type">type</span>&nbsp;<span class="var-name">$types</span> = <span class="var-default">array('gif','jpg','png','jpeg')</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setLimitWidth" title="details" class="method-name">setLimitWidth</a>
											([<span class="var-type">type</span>&nbsp;<span class="var-name">$width</span> = <span class="var-default">0</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setThumbHeight" title="details" class="method-name">setThumbHeight</a>
											([<span class="var-type">type</span>&nbsp;<span class="var-name">$height</span> = <span class="var-default">200</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setThumbWidth" title="details" class="method-name">setThumbWidth</a>
											([<span class="var-type">type</span>&nbsp;<span class="var-name">$width</span> = <span class="var-default">300</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setUploadPath" title="details" class="method-name">setUploadPath</a>
											([<span class="var-type">type</span>&nbsp;<span class="var-name">$path</span> = <span class="var-default">'./Data'</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#uploadAll" title="details" class="method-name">uploadAll</a>
											(<span class="var-type">type</span>&nbsp;<span class="var-name">$data</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#uploadFile" title="details" class="method-name">uploadFile</a>
											(<span class="var-type">type</span>&nbsp;<span class="var-name">$file</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">type</span>
										<a href="#writeFile" title="details" class="method-name">writeFile</a>
											(<span class="var-type">type</span>&nbsp;<span class="var-name">$file</span>, <span class="var-type">type</span>&nbsp;<span class="var-name">$content</span>)
									</div>
											</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">方法</div>
		<div class="nav-bar">
			<a href="#sec-description">描述</a> |
													<a href="#sec-method-summary">方法</a> (<span class="disabled">详情</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">24</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">构造方法</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">File</span>
		<span class="method-name">
			__construct
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodcreateDir" id="createDir"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">createDir</span> (line <span class="line-number">207</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">创建多层目录</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			createDir
		</span>
					(<span class="var-type">type</span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetDir" id="getDir"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getDir</span> (line <span class="line-number">103</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">取得目录下的文件和目录列表</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">type</span>
		<span class="method-name">
			getDir
		</span>
					(<span class="var-type">type</span>&nbsp;<span class="var-name">$dir</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$dir</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetExtName" id="getExtName"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getExtName</span> (line <span class="line-number">190</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">取得文件的扩展名</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">type</span>
		<span class="method-name">
			getExtName
		</span>
					(<span class="var-type">type</span>&nbsp;<span class="var-name">$filename</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$filename</span>			</li>
				</ul>
		
			
	</div>
<a name="methodisExist" id="isExist"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">isExist</span> (line <span class="line-number">199</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">判断文件或目录是否存在</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">type</span>
		<span class="method-name">
			isExist
		</span>
					(<span class="var-type">type</span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
<a name="methodreadFile" id="readFile"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">readFile</span> (line <span class="line-number">118</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">读取文件内容</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">type</span>
		<span class="method-name">
			readFile
		</span>
					(<span class="var-type">type</span>&nbsp;<span class="var-name">$file</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$file</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetIsRename" id="setIsRename"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">setIsRename</span> (line <span class="line-number">39</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">设置上传的文件是否重新命名 true：是，false：不是，默认为重新命名</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setIsRename
		</span>
					([<span class="var-type">type</span>&nbsp;<span class="var-name">$status</span> = <span class="var-default">true</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$status</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetLimitHeight" id="setLimitHeight"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">setLimitHeight</span> (line <span class="line-number">85</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">设置允许上传的图片高度</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setLimitHeight
		</span>
					([<span class="var-type">type</span>&nbsp;<span class="var-name">$height</span> = <span class="var-default">0</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$height</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetLimitSize" id="setLimitSize"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">setLimitSize</span> (line <span class="line-number">61</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">设置最大允许上传的大小 单位：KB</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setLimitSize
		</span>
					([<span class="var-type">type</span>&nbsp;<span class="var-name">$size</span> = <span class="var-default">200</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$size</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetLimitType" id="setLimitType"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">setLimitType</span> (line <span class="line-number">69</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">设置允许上传的文件类型</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setLimitType
		</span>
					([<span class="var-type">type</span>&nbsp;<span class="var-name">$types</span> = <span class="var-default">array('gif','jpg','png','jpeg')</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$types</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetLimitWidth" id="setLimitWidth"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">setLimitWidth</span> (line <span class="line-number">77</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">设置允许上传的图片宽度</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setLimitWidth
		</span>
					([<span class="var-type">type</span>&nbsp;<span class="var-name">$width</span> = <span class="var-default">0</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$width</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetThumbHeight" id="setThumbHeight"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">setThumbHeight</span> (line <span class="line-number">54</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">设置缩略图的高度</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setThumbHeight
		</span>
					([<span class="var-type">type</span>&nbsp;<span class="var-name">$height</span> = <span class="var-default">200</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$height</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetThumbWidth" id="setThumbWidth"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">setThumbWidth</span> (line <span class="line-number">47</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">设置缩略图的宽度</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setThumbWidth
		</span>
					([<span class="var-type">type</span>&nbsp;<span class="var-name">$width</span> = <span class="var-default">300</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$width</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetUploadPath" id="setUploadPath"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">setUploadPath</span> (line <span class="line-number">93</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">设置图片上传到得服务器路径</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setUploadPath
		</span>
					([<span class="var-type">type</span>&nbsp;<span class="var-name">$path</span> = <span class="var-default">'./Data'</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
<a name="methoduploadAll" id="uploadAll"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">uploadAll</span> (line <span class="line-number">167</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">上传所有文件</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			uploadAll
		</span>
					(<span class="var-type">type</span>&nbsp;<span class="var-name">$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$data</span>			</li>
				</ul>
		
			
	</div>
<a name="methoduploadFile" id="uploadFile"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">uploadFile</span> (line <span class="line-number">137</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">上传文件</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			uploadFile
		</span>
					(<span class="var-type">type</span>&nbsp;<span class="var-name">$file</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$file</span>			</li>
				</ul>
		
			
	</div>
<a name="methodwriteFile" id="writeFile"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">writeFile</span> (line <span class="line-number">128</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">写入文件内容</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">type</span>
		<span class="method-name">
			writeFile
		</span>
					(<span class="var-type">type</span>&nbsp;<span class="var-name">$file</span>, <span class="var-type">type</span>&nbsp;<span class="var-name">$content</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$file</span>			</li>
					<li>
				<span class="var-type">type</span>
				<span class="var-name">$content</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>
	</div></body>
</html>